//
//  HomeSixCollectionViewCell.m
//  CommunitySupermarketProiect
//
//  Created by 吕惠卿 on 2017/10/12.
//  Copyright © 2017年 吕惠卿. All rights reserved.
//

#import "HomeSixCollectionViewCell.h"

@implementation HomeSixCollectionViewCell
-(id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self creatUI];
    }
    return self;
}
-(void)creatUI{
    UIImageView *line = [[UIImageView alloc]init];
    line.backgroundColor = LineColor;
    [self addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.contentView.mas_bottom).with.offset(0);
        make.left.equalTo(self.contentView.mas_left).with.offset(0);
        make.right.equalTo(self.contentView.mas_right).with.offset(0);
        make.height.mas_equalTo(5);
    }];
    _logLab = [[UILabel alloc]init];
    _logLab.textAlignment = NSTextAlignmentCenter;
    _logLab.layer.borderColor = NavColor.CGColor;
    _logLab.layer.borderWidth = 1;
    _logLab.layer.cornerRadius = 3;
    _logLab.font = [UIFont systemFontOfSize:11.0];
    _logLab.text = @"大牌精选";
    _logLab.textColor = NavColor;
    [self addSubview:_logLab];
    [_logLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(14);
        make.right.equalTo(self.mas_right).with.offset(-14);
        make.bottom.equalTo(line.mas_top).with.offset(-8);
        make.height.mas_equalTo(17);
    }];
    _nameLab = [[UILabel alloc]init];
    _nameLab.textAlignment = NSTextAlignmentCenter;
    _nameLab.font = [UIFont systemFontOfSize:14.0];
    [self addSubview:_nameLab];
    [_nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(2);
        make.right.equalTo(self.mas_right).with.offset(-2);
        make.bottom.equalTo(_logLab.mas_top).with.offset(0);
        make.height.mas_equalTo(25);
    }];
    _imgView = [[UIImageView alloc]init];
    _imgView.layer.borderColor = LineColor.CGColor;
    _imgView.layer.borderWidth = 1;
    [self addSubview:_imgView];
    [_imgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).with.offset(10);
        make.right.equalTo(self.mas_right).with.offset(-10);
        make.top.equalTo(self.mas_top).with.offset(2);
        make.bottom.equalTo(_nameLab.mas_top).with.offset(-2);
    }];
}
@end
